﻿@{
    Layout = null;
}
<!DOCTYPE html>
<html>
<head>
    <meta name="viewport" content="width=device-width" />
    <title>排班备注</title>
    <link href="~/lib/ligerUI/skins/Aqua/css/ligerui-all.css" rel="stylesheet" type="text/css" />
    <link href="~/lib/ligerUI/skins/ligerui-icons.css" rel="stylesheet" type="text/css" />
    <link href="~/lib/ligerUI/skins/Gray/css/all.css" rel="stylesheet" type="text/css" />
    <link href="~/Content/css/common.css" rel="stylesheet" type="text/css" />
    <script src="~/lib/jquery/jquery-1.9.0.min.js" type="text/javascript"></script>
    <script src="~/lib/ligerUI/js/ligerui.all.js"></script>
    <script src="~/Scripts/common.js?v=@DateTime.Now.ToString("yyyyMMdd")"></script>
</head>
<body>
    <div style="width:550px;">
        <div style="text-align:left; margin:15px;">
            <div style="float:left;">备注信息：</div><textarea id="txtRemarks" name="txtRemarks" cols="65" rows="12" class="l-textarea" maxlength="2000" style="padding:5px;"></textarea>
        </div>
        <div style="text-align:center;">
            <input id="btnSubmit" type="button" value="保存" class="l-button" onclick="save()" />&nbsp;&nbsp;&nbsp;
            <input id="btnCancel" type="button" value="刷新" class="l-button" onclick="window.location.reload();" />
        </div>
        <input type="hidden" id="hdnId" value="0" />
    </div>
    <script type="text/javascript">
        $(document).ready(function () {
            loadInfo();
        });
        function loadInfo() {
            $.ajax({
                url: "/Scheduling/SchedulingRemark/GetSchedulingRemark",
                type: "post",
                data: { rnd: new Date().getMilliseconds() },
                success: function (r) {
                    var r = $.parseJSON(r);
                    if (r.Result == 1) {
                        $("#txtRemarks").val(r.Body.Remarks);
                    }
                    else if (r.Result == 0) {
                        $.ligerDialog.error(r.Body);
                    }
                    else {
                        $.ligerDialog.error("程序错误");
                    }
                }
            });
        }

        function save() {
            var id = $("#hdnId").val();
            var remarks = $("#txtRemarks").val();
            //if (IsEmpty($("#txtRemarks").val())) { $.ligerDialog.error("请输入备注信息"); return; }
            $.ajax({
                url: "/SchedulingRemark/Save",
                type: "post",
                data: {
                    Id: id,
                    Remarks: remarks
                },
                success: function (r) {
                    var r = $.parseJSON(r);
                    if (r.Result == 1) {
                        $.ligerDialog.success("保存成功");
                    }
                    else if (r.Result == 0) {
                        $.ligerDialog.error(r.Body);
                    }
                    else {
                        $.ligerDialog.error("程序错误");
                    }
                }
            });
        }
    </script>
</body>
</html>